package com.lagou.base;

import com.alibaba.fastjson.JSONObject;

public enum StatusCode {

    SUCCESS(1,"成功"),
    FAIL(0,"失败");

    private int code;
    private String message;

    StatusCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
    StatusCode(){};

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        JSONObject jo = new JSONObject();
        jo.put("status",code);
        jo.put("msg",message);
        return jo.toString();
    }
}
